Integrand size = 48, antiderivative size = 75 \[ \int \frac {a b B-a^2 C+b^2 B \sec (c+d x)+b^2 C \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\frac {(b B-a C) x}{a}-\frac {2 b (b B-2 a C) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a \sqrt {a-b} \sqrt {a+b} d} \]
(B*b-C*a)*x/a-2*b*(B*b-2*C*a)*arctanh((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b) ^(1/2))/a/d/(a-b)^(1/2)/(a+b)^(1/2)
Time = 0.45 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.01 \[ \int \frac {a b B-a^2 C+b^2 B \sec (c+d x)+b^2 C \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\frac {(b B-a C) (c+d x)+\frac {2 b (b B-2 a C) \text {arctanh}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}}{a d} \]
Integrate[(a*b*B - a^2*C + b^2*B*Sec[c + d*x] + b^2*C*Sec[c + d*x]^2)/(a + b*Sec[c + d*x])^2,x]
((b*B - a*C)*(c + d*x) + (2*b*(b*B - 2*a*C)*ArcTanh[((-a + b)*Tan[(c + d*x )/2])/Sqrt[a^2 - b^2]])/Sqrt[a^2 - b^2])/(a*d)
Time = 0.46 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.12, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {2014, 3042, 4407, 3042, 4318, 3042, 3138, 221}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {a^2 (-C)+a b B+b^2 B \sec (c+d x)+b^2 C \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx\) |
\(\Big \downarrow \) 2014 |
\(\displaystyle \frac {\int \frac {C \sec (c+d x) b^3+(b B-a C) b^2}{a+b \sec (c+d x)}dx}{b^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {C \csc \left (c+d x+\frac {\pi }{2}\right ) b^3+(b B-a C) b^2}{a+b \csc \left (c+d x+\frac {\pi }{2}\right )}dx}{b^2}\) |
\(\Big \downarrow \) 4407 |
\(\displaystyle \frac {\frac {b^2 x (b B-a C)}{a}-\frac {b^3 (b B-2 a C) \int \frac {\sec (c+d x)}{a+b \sec (c+d x)}dx}{a}}{b^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {b^2 x (b B-a C)}{a}-\frac {b^3 (b B-2 a C) \int \frac {\csc \left (c+d x+\frac {\pi }{2}\right )}{a+b \csc \left (c+d x+\frac {\pi }{2}\right )}dx}{a}}{b^2}\) |
\(\Big \downarrow \) 4318 |
\(\displaystyle \frac {\frac {b^2 x (b B-a C)}{a}-\frac {b^2 (b B-2 a C) \int \frac {1}{\frac {a \cos (c+d x)}{b}+1}dx}{a}}{b^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {b^2 x (b B-a C)}{a}-\frac {b^2 (b B-2 a C) \int \frac {1}{\frac {a \sin \left (c+d x+\frac {\pi }{2}\right )}{b}+1}dx}{a}}{b^2}\) |
\(\Big \downarrow \) 3138 |
\(\displaystyle \frac {\frac {b^2 x (b B-a C)}{a}-\frac {2 b^2 (b B-2 a C) \int \frac {1}{\left (1-\frac {a}{b}\right ) \tan ^2\left (\frac {1}{2} (c+d x)\right )+\frac {a+b}{b}}d\tan \left (\frac {1}{2} (c+d x)\right )}{a d}}{b^2}\) |
\(\Big \downarrow \) 221 |
\(\displaystyle \frac {\frac {b^2 x (b B-a C)}{a}-\frac {2 b^3 (b B-2 a C) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a d \sqrt {a-b} \sqrt {a+b}}}{b^2}\) |
((b^2*(b*B - a*C)*x)/a - (2*b^3*(b*B - 2*a*C)*ArcTanh[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/(a*Sqrt[a - b]*Sqrt[a + b]*d))/b^2
3.10.31.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x /Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
Int[(u_.)*((a_) + (b_.)*(v_))^(m_)*((A_.) + (B_.)*(v_) + (C_.)*(v_)^2), x_S ymbol] :> Simp[1/b^2 Int[u*(a + b*v)^(m + 1)*Simp[b*B - a*C + b*C*v, x], x], x] /; FreeQ[{a, b, A, B, C}, x] && EqQ[A*b^2 - a*b*B + a^2*C, 0] && LeQ [m, -1]
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{ e = FreeFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d) Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0]
Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbo l] :> Simp[1/b Int[1/(1 + (a/b)*Sin[e + f*x]), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[c*(x/a), x] - Simp[(b*c - a*d)/a Int[Csc[e + f* x]/(a + b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Time = 0.25 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.08
method | result | size |
derivativedivides | \(\frac {-\frac {2 b \left (B b -2 C a \right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a \sqrt {\left (a +b \right ) \left (a -b \right )}}+\frac {2 \left (B b -C a \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}}{d}\) | \(81\) |
default | \(\frac {-\frac {2 b \left (B b -2 C a \right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a \sqrt {\left (a +b \right ) \left (a -b \right )}}+\frac {2 \left (B b -C a \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}}{d}\) | \(81\) |
risch | \(\frac {x B b}{a}-C x +\frac {b^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {-i a^{2}+i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right ) B}{\sqrt {a^{2}-b^{2}}\, d a}-\frac {2 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {-i a^{2}+i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right ) C}{\sqrt {a^{2}-b^{2}}\, d}-\frac {b^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right ) B}{\sqrt {a^{2}-b^{2}}\, d a}+\frac {2 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right ) C}{\sqrt {a^{2}-b^{2}}\, d}\) | \(302\) |
int((B*a*b-C*a^2+b^2*B*sec(d*x+c)+b^2*C*sec(d*x+c)^2)/(a+b*sec(d*x+c))^2,x ,method=_RETURNVERBOSE)
1/d*(-2*b*(B*b-2*C*a)/a/((a+b)*(a-b))^(1/2)*arctanh((a-b)*tan(1/2*d*x+1/2* c)/((a+b)*(a-b))^(1/2))+2*(B*b-C*a)/a*arctan(tan(1/2*d*x+1/2*c)))
Time = 0.29 (sec) , antiderivative size = 285, normalized size of antiderivative = 3.80 \[ \int \frac {a b B-a^2 C+b^2 B \sec (c+d x)+b^2 C \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\left [-\frac {2 \, {\left (C a^{3} - B a^{2} b - C a b^{2} + B b^{3}\right )} d x + {\left (2 \, C a b - B b^{2}\right )} \sqrt {a^{2} - b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right )}{2 \, {\left (a^{3} - a b^{2}\right )} d}, -\frac {{\left (C a^{3} - B a^{2} b - C a b^{2} + B b^{3}\right )} d x - {\left (2 \, C a b - B b^{2}\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right )}{{\left (a^{3} - a b^{2}\right )} d}\right ] \]
integrate((B*a*b-C*a^2+b^2*B*sec(d*x+c)+b^2*C*sec(d*x+c)^2)/(a+b*sec(d*x+c ))^2,x, algorithm="fricas")
[-1/2*(2*(C*a^3 - B*a^2*b - C*a*b^2 + B*b^3)*d*x + (2*C*a*b - B*b^2)*sqrt( a^2 - b^2)*log((2*a*b*cos(d*x + c) - (a^2 - 2*b^2)*cos(d*x + c)^2 - 2*sqrt (a^2 - b^2)*(b*cos(d*x + c) + a)*sin(d*x + c) + 2*a^2 - b^2)/(a^2*cos(d*x + c)^2 + 2*a*b*cos(d*x + c) + b^2)))/((a^3 - a*b^2)*d), -((C*a^3 - B*a^2*b - C*a*b^2 + B*b^3)*d*x - (2*C*a*b - B*b^2)*sqrt(-a^2 + b^2)*arctan(-sqrt( -a^2 + b^2)*(b*cos(d*x + c) + a)/((a^2 - b^2)*sin(d*x + c))))/((a^3 - a*b^ 2)*d)]
\[ \int \frac {a b B-a^2 C+b^2 B \sec (c+d x)+b^2 C \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=- \int \left (- \frac {B b}{a + b \sec {\left (c + d x \right )}}\right )\, dx - \int \frac {C a}{a + b \sec {\left (c + d x \right )}}\, dx - \int \left (- \frac {C b \sec {\left (c + d x \right )}}{a + b \sec {\left (c + d x \right )}}\right )\, dx \]
-Integral(-B*b/(a + b*sec(c + d*x)), x) - Integral(C*a/(a + b*sec(c + d*x) ), x) - Integral(-C*b*sec(c + d*x)/(a + b*sec(c + d*x)), x)
Exception generated. \[ \int \frac {a b B-a^2 C+b^2 B \sec (c+d x)+b^2 C \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\text {Exception raised: ValueError} \]
integrate((B*a*b-C*a^2+b^2*B*sec(d*x+c)+b^2*C*sec(d*x+c)^2)/(a+b*sec(d*x+c ))^2,x, algorithm="maxima")
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?` f or more de
Leaf count of result is larger than twice the leaf count of optimal. 309 vs. \(2 (68) = 136\).
Time = 0.32 (sec) , antiderivative size = 309, normalized size of antiderivative = 4.12 \[ \int \frac {a b B-a^2 C+b^2 B \sec (c+d x)+b^2 C \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\frac {\frac {{\left (\sqrt {-a^{2} + b^{2}} C {\left (a + b\right )} {\left | a \right |} {\left | -a + b \right |} - \sqrt {-a^{2} + b^{2}} B b {\left | a \right |} {\left | -a + b \right |} + \sqrt {-a^{2} + b^{2}} {\left (a b - 2 \, b^{2}\right )} B {\left | -a + b \right |} - {\left (a^{2} - 3 \, a b\right )} \sqrt {-a^{2} + b^{2}} C {\left | -a + b \right |}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor + \arctan \left (\frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-\frac {b + \sqrt {{\left (a + b\right )} {\left (a - b\right )} + b^{2}}}{a - b}}}\right )\right )}}{{\left (a^{2} - 2 \, a b + b^{2}\right )} a^{2} + {\left (a^{2} b - 2 \, a b^{2} + b^{3}\right )} {\left | a \right |}} - \frac {{\left (C a^{2} - B a b - 3 \, C a b + 2 \, B b^{2} + C a {\left | a \right |} - B b {\left | a \right |} + C b {\left | a \right |}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor + \arctan \left (\frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-\frac {b - \sqrt {{\left (a + b\right )} {\left (a - b\right )} + b^{2}}}{a - b}}}\right )\right )}}{a^{2} - b {\left | a \right |}}}{d} \]
integrate((B*a*b-C*a^2+b^2*B*sec(d*x+c)+b^2*C*sec(d*x+c)^2)/(a+b*sec(d*x+c ))^2,x, algorithm="giac")
((sqrt(-a^2 + b^2)*C*(a + b)*abs(a)*abs(-a + b) - sqrt(-a^2 + b^2)*B*b*abs (a)*abs(-a + b) + sqrt(-a^2 + b^2)*(a*b - 2*b^2)*B*abs(-a + b) - (a^2 - 3* a*b)*sqrt(-a^2 + b^2)*C*abs(-a + b))*(pi*floor(1/2*(d*x + c)/pi + 1/2) + a rctan(tan(1/2*d*x + 1/2*c)/sqrt(-(b + sqrt((a + b)*(a - b) + b^2))/(a - b) )))/((a^2 - 2*a*b + b^2)*a^2 + (a^2*b - 2*a*b^2 + b^3)*abs(a)) - (C*a^2 - B*a*b - 3*C*a*b + 2*B*b^2 + C*a*abs(a) - B*b*abs(a) + C*b*abs(a))*(pi*floo r(1/2*(d*x + c)/pi + 1/2) + arctan(tan(1/2*d*x + 1/2*c)/sqrt(-(b - sqrt((a + b)*(a - b) + b^2))/(a - b))))/(a^2 - b*abs(a)))/d
Time = 21.37 (sec) , antiderivative size = 1169, normalized size of antiderivative = 15.59 \[ \int \frac {a b B-a^2 C+b^2 B \sec (c+d x)+b^2 C \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\text {Too large to display} \]
int(((B*b^2)/cos(c + d*x) - C*a^2 + (C*b^2)/cos(c + d*x)^2 + B*a*b)/(a + b /cos(c + d*x))^2,x)
(2*C*b^2*atan((C^2*a^4*sin(c/2 + (d*x)/2) + B^2*a^2*b^2*sin(c/2 + (d*x)/2) + 3*C^2*a^2*b^2*sin(c/2 + (d*x)/2) - 2*B*C*a*b^3*sin(c/2 + (d*x)/2) - 2*B *C*a^3*b*sin(c/2 + (d*x)/2))/(a*cos(c/2 + (d*x)/2)*(C^2*a^3 + B^2*a*b^2 + 3*C^2*a*b^2 - 2*B*C*b^3 - 2*B*C*a^2*b))))/(d*(a^2 - b^2)) - (2*C*a^2*atan( (C^2*a^4*sin(c/2 + (d*x)/2) + B^2*a^2*b^2*sin(c/2 + (d*x)/2) + 3*C^2*a^2*b ^2*sin(c/2 + (d*x)/2) - 2*B*C*a*b^3*sin(c/2 + (d*x)/2) - 2*B*C*a^3*b*sin(c /2 + (d*x)/2))/(a*cos(c/2 + (d*x)/2)*(C^2*a^3 + B^2*a*b^2 + 3*C^2*a*b^2 - 2*B*C*b^3 - 2*B*C*a^2*b))))/(d*(a^2 - b^2)) - (2*C*b^3*log((a*sin(c/2 + (d *x)/2) - b*sin(c/2 + (d*x)/2) + cos(c/2 + (d*x)/2)*(a^2 - b^2)^(1/2))/cos( c/2 + (d*x)/2)))/(d*(a^2 - b^2)^(3/2)) + (2*B*a*b*atan((C^2*a^4*sin(c/2 + (d*x)/2) + B^2*a^2*b^2*sin(c/2 + (d*x)/2) + 3*C^2*a^2*b^2*sin(c/2 + (d*x)/ 2) - 2*B*C*a*b^3*sin(c/2 + (d*x)/2) - 2*B*C*a^3*b*sin(c/2 + (d*x)/2))/(a*c os(c/2 + (d*x)/2)*(C^2*a^3 + B^2*a*b^2 + 3*C^2*a*b^2 - 2*B*C*b^3 - 2*B*C*a ^2*b))))/(d*(a^2 - b^2)) - (B*a*b^2*log((a*sin(c/2 + (d*x)/2) - b*sin(c/2 + (d*x)/2) + cos(c/2 + (d*x)/2)*(a^2 - b^2)^(1/2))/cos(c/2 + (d*x)/2)))/(d *(a^2 - b^2)^(3/2)) + (2*C*a^2*b*log((a*sin(c/2 + (d*x)/2) - b*sin(c/2 + ( d*x)/2) + cos(c/2 + (d*x)/2)*(a^2 - b^2)^(1/2))/cos(c/2 + (d*x)/2)))/(d*(a ^2 - b^2)^(3/2)) + (B*b^4*log((a*sin(c/2 + (d*x)/2) - b*sin(c/2 + (d*x)/2) + cos(c/2 + (d*x)/2)*(a^2 - b^2)^(1/2))/cos(c/2 + (d*x)/2)))/(a*d*(a^2 - b^2)^(3/2)) - (2*B*b^3*atan((C^2*a^4*sin(c/2 + (d*x)/2) + B^2*a^2*b^2*s...